import { ConnectorDatabaseType } from '@/services/connector';
import { invoke } from '@tauri-apps/api/core';

export const metaFindClass = async (classIdentifier: string): Promise<any> => {
    let res = await invoke('plugin:mg-platform|meta_find_class', { classIdentifier: classIdentifier });
    console.log(res);
    return res;
}
export const metaDomainClasses = async (domainIdentifier: string): Promise<any> => {
    let res = await invoke('plugin:mg-platform|meta_domain_classes', { domainIdentifier: domainIdentifier });
    console.log(res);
    return res;
}

export const metaGenerateSQLByDomain = async (dsId: number, domainIdentifier: string, databaseType: ConnectorDatabaseType): Promise<any> => {
    let res = await invoke('plugin:mg-platform|meta_generate_sql', {
        datasource: dsId,
        domainIdentifier: domainIdentifier,
        databaseType: databaseType
    });
    console.log(res);
    return res;
}